package com.wisdomsky.project.param.service.business.impl;

import com.wisdomsky.project.param.mapper.ParamMapper;
import com.wisdomsky.project.param.pojo.Params;
import com.wisdomsky.project.param.service.business.ParamsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ParamsServiceImpl implements ParamsService {

    @Autowired
    private ParamMapper paramMapper;

    @Override
    public List<Params> retrieveRoles_0() {
        return paramMapper.findParamsList(Params.builder().column("rid code,\"name\"").table("wis_param_roles").type(0).build());
    }
    @Override
    public List<Params> retrieveRoles() {
        return paramMapper.findParamsList(Params.builder().column("rid code,\"name\"").table("wis_param_roles").type(1).build());
    }

    @Override
    public List<Params> retrieveProjectRoles() {
        return paramMapper.findParamsList(Params.builder().column("rid code,\"name\"").table("wis_param_roles").type(2).build());
    }

    @Override
    public List<Params> retrieveSystem() {
        return paramMapper.findParamsList(Params.builder().column("code,\"name\"").type(0).table("wis_param_system").build());
    }

    @Override
    public List<Params> retrieveRecurrent() {
        return paramMapper.findParamsList(Params.builder().column("code,\"name\"").type(0).table("wis_param_recurrent").build());
    }

    @Override
    public List<Params> retrieveRepairState() {
        return paramMapper.findParamsList(Params.builder().column("code,\"name\"").type(0).table("wis_param_repair_state").build());
    }

    @Override
    public List<Params> retrieveProjectState() {
        return paramMapper.findParamsList(Params.builder().column("code,\"name\"").type(0).table("wis_param_project_state").build());
    }
}
